﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fotoalbum.DAL.UI
{
    public partial class Form1 : Form
    {
        Fotoalbum.DAL.IDataAdapter _dbAdapter = Fotoalbum.DAL.DataAdapter.CreateInstance();
        
        #region Singelton
        private static Form1 _instance;
        private Form1(Form parent)
        {
            if (parent != null)
                new FotoStammbuch.Core.MdiChildExtender(this, parent);
            InitializeComponent();
            dataGridView1.DataSource = _dbAdapter.AlleBilderAuslesen();
        }
        public static void Show(Form owner)
        {
            if (_instance == null)
                _instance = new Form1(owner);

            _instance.Show();
        }
        #endregion
    }
}
